import Vue from 'vue'
import VueRouter from 'vue-router'
// 首页
import Home from '../views/home/Index.vue'
// 登录
import Login from '../views/login/Index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Home
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/register',
    component: () => import('../views/register/Index.vue')
  },
  {
    path: '/404',
    component: () => import('../views/404/Index.vue')
  },
  {
    path: '*',
    redirect: '/404'
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
